<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html lang="en">
<head>
	<meta http-equiv="Content-Type" content="text/html;charset=UTF-8">
	<title>date</title>
	<script type="text/javascript">
	function run () {
		var date1 = new Date('2016/10/1');
		// alert(date1.getMonth());

		var date2 = new Date();
		var guoqingtime = Math.ceil(date1.getTime()/1000);
		var currenttime = Math.ceil(date2.getTime()/1000);

		var difftime = guoqingtime-currenttime;

		var xbsdate = Math.floor(difftime/86400);
		var xbshour = Math.floor((difftime%86400)/3600);
		var xbsfeng = Math.floor(((difftime%86400)%3600)/60);
		var xbsmiao = Math.floor(((difftime%86400)%3600)%60);
		// document.write();
		box = document.getElementById('box');
		box.innerHTML = xbsdate+'天'+xbshour+'小时'+xbsfeng+'分钟'+xbsmiao+'秒';
	}

	setInterval(run,1000);



	</script>
</head>
<body>
	<p id="box"></p>
</body>
</html>